package xyz.thoughtset.viewer.apis.client.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import xyz.thoughtset.viewer.common.crud.api.controller.CrudController;
import xyz.thoughtset.viewer.modules.step.service.BlockInfoService;
import xyz.thoughtset.viewer.modules.step.service.QueryBlockService;

import java.util.List;

@RestController
@RequestMapping("/qb/")
public class QueryBlockController extends CrudController {
    @Autowired
    private BlockInfoService blockInfoService;
    @Autowired
    private QueryBlockService queryBlockService;


    @PostMapping(value = "sort" , produces = MediaType.APPLICATION_JSON_VALUE)
    public Object sort(@RequestBody List<String> items){
        return queryBlockService.saveBlockOrder(items);
    }
    @PostMapping(value = "sort2" , produces = MediaType.APPLICATION_JSON_VALUE)
    public Object sort2(@RequestBody List<String> items){
        return blockInfoService.saveBlockOrder(items);
    }

}
